using System;
using System.Collections.Generic;
using System.Text;
using NUnit.Framework;
using BUS;
using DAO;
using DTO;
using System.Data;
namespace TestQLKS
{

    [TestFixture]
    public class CPHONG
    {
        [Test]
        public void LayDanhSachPhongDAO()
        {
            List<CPHONGDTO> ds = new List<CPHONGDTO>();
            ds = DAO.CPHONGDAO.LayDanhSachPhong();
            Assert.AreEqual(ds.Count, 9);

        }
        [Test]
        public void layDanhSachPhong()
        {

            DataTable dt = new DataTable();
            dt = BUS.CPHONGBUS.LayBangPhong();
            Assert.AreNotEqual(dt, null);

        }

        [Test]
        public void LayThongTinPhongTest()
        {
            int maPhong = 8;
            CPHONGDTO phong = new CPHONGDTO();
            phong = CPHONGDAO.LayThongTinPhong(maPhong);
            Assert.AreEqual(phong.TenPhong, "asd");
        }
        [Test]
        public void CapNhatThongTinPhonggTestDAO()
        {
            CPHONGDTO phong = new CPHONGDTO();
            phong.MaPhong = 8;
            phong.TenPhong = "asd";
            phong.MaLoaiPhong = 20;
            CPHONGDAO phongDAO = new CPHONGDAO();
            phongDAO.CapNhatThongTinPhong(phong);
            CPHONGDTO ph = new CPHONGDTO();
            ph = CPHONGDAO.LayThongTinPhong(8);
            Assert.AreEqual(ph.TenPhong, "asd");
        }
        [Test]
        public void TestLayMaPhongChuaThanhToan()
        {
            int kq = CPHONGDAO.LayMaPhongChuaThanhToan("B3");
            Assert.AreEqual(kq, 16);
        }

    }
}
